package com.lh.common.utils;

import java.util.Calendar;

/**
 * @author liuhe
 * @date 2020/07/03
 */
public class DateUtils {

    /**
     * 系统当前时间到0点的秒数
     *
     * @return
     */
    public static long getNowToZeroMills() {
        Calendar calendar = Calendar.getInstance();
        //加1表示明天的0点
        calendar.add(Calendar.DAY_OF_MONTH, 1);
        //24小时制
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        long seconds = (calendar.getTimeInMillis() - System.currentTimeMillis()) / 1000;
        return seconds;
    }
}
